﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using Medical.Business;

public partial class control_EquipmentImg : System.Web.UI.UserControl
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            //医院环境
            DataTable dtEnvironment = new BisBanner().GetList(AdverTypeEnum.Environment);
            rptEquipment.DataSource = dtEnvironment;
            rptEquipment.DataBind();

           //友情链接
            DataTable dtLink = new BisLinkInfo().GetAllLink();
            DataRow[] drLinkList1 = dtLink.Select("LinkType=1");
            DataTable dtNewLink1 = dtLink.Clone();
            foreach (DataRow drLink in drLinkList1)
            {
                DataRow drTem = dtNewLink1.NewRow();
                foreach (DataColumn column in dtLink.Columns)
                {
                    drTem[column.ColumnName] = drLink[column.ColumnName];
                }
                dtNewLink1.Rows.Add(drTem);
            }
            rptLink1.DataSource = dtNewLink1;
            rptLink1.DataBind();

            DataRow[] drLinkList2 = dtLink.Select("LinkType=3");
            DataTable dtNewLink2 = dtLink.Clone();
            foreach (DataRow drLink in drLinkList2)
            {
                DataRow drTem = dtNewLink2.NewRow();
                foreach (DataColumn column in dtLink.Columns)
                {
                    drTem[column.ColumnName] = drLink[column.ColumnName];
                }
                dtNewLink2.Rows.Add(drTem);
            }
            rptLink2.DataSource = dtNewLink2;
            rptLink2.DataBind();
        }
    }
}